package top.lucky.dubboorder.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.lucky.api.bean.UserAddress;
import top.lucky.api.service.OrderService;

import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    OrderService orderService;

    @GetMapping("/getOrder")
    public List<UserAddress> getOrder(@RequestParam("userId") String userId){
        return orderService.initOrder(userId);
    }
    
    public static void main(String[] args) {
        String s = "a cc b ee d";
        String[] s1 = s.split(" ");
        Arrays.sort(s1);
        for (String s2 : s1) {
            System.out.println(s2);
        }
        System.out.println(s1);
    }
}
